home *** CD-ROM | disk | FTP | other *** search
- *****Listing 3*****
-
-
- #include <stdio.h>
-
- void trace1(const char *filename, int line)
- {
- static unsigned int counter = 0;
-
- ++counter;
- fprintf(stderr, "T1 %3u: file: %s, line: %d\n",
- counter, filename, line)
- {
- static unsigned int counter = 0;
-
- ++counter;
- fprintf(stderr, "T2 %3u: file: %s, line: %d\n\n",
- counter, filename, line);
- }
-
- The output produced from this version is:
-
- T1> 1: file: t1l.c, line: 11
- inside f
- T2> 1: file: t1.c, line: 11
-
- T1> 2: file: t1g.c, line: 7
- inside f
- T2> 2: file: t1g.c, line: 7
-
- T1> 3: file: t1.c, line: 13
- inside f
- T2> 3: file: t1.c, line: 13
-
- where T1 and T2 indicate the output from trace1 and trace2, respectively.
-
-
- *******************
-